package com.ewancle.studiousfamilybackend.controller.mvc;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RestController
public class TestController {

    @GetMapping("/newlogin/login.do")
    public String getThreadName(@RequestParam("name") String name) {
        System.out.println("请求的用户名="+name);
        return Thread.currentThread().toString();
    }

    @GetMapping("/reactive")
    public Mono<String> reactive() {
        return Mono.just("Hello Reactor!").doOnNext(s -> {
            System.out.println("Reactive on " + Thread.currentThread());
        });
    }
}
